<!-- <script src="../manager/js/jquery-3.5.0.js"></script> -->
<!-- <script src="../manager/layer/layer.js"></script> -->
<!-- <script src="../manager/js/template-web.js"></script> -->
<script>
	$(function(){
		$.getJSON("../order",{
			"opr":"query"
			},function(result){
				if(result.code==200){
					let orderHtml = template("orderTpl",{
						data:result.data.orders
					});
					$("#orderData").html(orderHtml);
					//设置个人信息
					let u = result.data.user
					$("#user_ico_img").attr("src","../"+u.avatar);
					console.log(u.avatar);
					$("#account").html(u.account);
				}else if(result.code==102){
					location.href="../usernotlogin.jsp";
				}else{
					layer.alert("系统维护中")
				}
			})
			
	})
</script>
<script id="orderTpl" type="text/html">
	{{each data order}}
		<tr>
			<td><a href="#" onclick="view({{order.id}})" class="orange" >{{order.orderno}}</a></td>
			<td>{{order.ordertime}}</td>
			<td colspan="3">{{order.receiveinfo}}</td>
			<td>{{order.money}}</td>
			<td>{{order.status}}</td>
		<tr>
     {{/each}}
</script>
<div class="userinfo_bar">
	<b class="f14">您好，<span id="account"></span>！欢迎回来!
	</b>
</div>
<div class="box clearfix">
	<h3>用户信息</h3>
	<dl class="userinfo_box">
		<dt>
			<a class="ico"><img id="user_ico_img" src="" width="100"
				height="100" alt="" /></a> <a class="blue" href="javascript:void(0)"
				id="changeAvatar">修改头像</a>
		</dt>
		<dd>
			<table width="100%" cellpadding="0" cellspacing="0">
				<col width="350px" />
				<tr>
					<td>你的订单交易总数量：<b class="red2">2 笔</b>&nbsp;&nbsp;&nbsp;<a
						class="blue orderlist" href="javascript:void(0)">进入订单列表</a></td>
				</tr>
				<tr>
					<td>总消费额：<b class="red2">￥2040.00</b></td>

				</tr>
			</table>

			<div class="stat">
				<span>待评价商品：<label>(<b class="red2">1</b>)
				</label></span> <span>待付款订单：<label>(<b class="red2">0</b>)
				</label></span> <span>待确认收货：<label>(<b class="red2"><a href="">0</a></b>)
				</label></span>
			</div>
		</dd>
	</dl>
</div>
<h3 class="bg">我的订单</h3>
<div class="box m_10">
	<table class="list_table" width="100%" cellpadding="0" cellspacing="0">
		<col width="140px" />
		<thead>
			<tr>
				<th>订单编号</th>
				<th>下单日期</th>
				<th colspan="3">收货详情</th>
				<th>总金额</th>
				<th>订单状态</th>
			</tr>
		</thead>
		<tbody id="orderData">
		</tbody>
		<tfoot>
			<tr>
				<td colspan="6" class="t_r"><a class="blue orderlist"
					href="javascript:void(0)">更多订单&gt;&gt;</a></td>
			</tr>
		</tfoot>
	</table>
</div>